package com.frejoys.admin.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.frejoys.common.aop.Authority;
import com.frejoys.common.aop.Authorization;
import com.frejoys.common.constant.CommonConstant;
import com.frejoys.common.dto.admin.UserLevelListDto;
import com.frejoys.common.dto.admin.UserLevelMoneyListDto;
import com.frejoys.common.dto.admin.UserLevelMoneyLogListDto;
import com.frejoys.common.response.Result;
import com.frejoys.common.vo.admin.UserLevelAgentVo;
import com.frejoys.common.vo.admin.UserLevelMoneyListVo;
import com.frejoys.common.vo.admin.UserLevelMoneyLogListVo;
import com.frejoys.service.UserLevelMoneyLogService;
import com.frejoys.service.UserLevelMoneyService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Tag(name = "用户关系推广收益", description = "用户关系推广收益")
@RestController
@RequiredArgsConstructor
@RequestMapping(CommonConstant.routePrefixAdmin)
@Authorization(Authority.Private)
public class AdminUserLevelMoneyController {

    private final UserLevelMoneyService userLevelMoneyService;

    private final UserLevelMoneyLogService userLevelMoneyLogService;

    @PostMapping("/userLevelMoney/userLevelMoneyListInfo")
    @Operation(summary = "用户推广收益列表")
    public Result<IPage<UserLevelMoneyListVo>> userLevelMoneyListInfo(@RequestBody @Validated UserLevelMoneyListDto dto){
        return Result.success(userLevelMoneyService.userLevelMoneyListInfo(dto));
    }


    @PostMapping("/userLevelMoney/userLevelMoneyLogListInfo")
    @Operation(summary = "用户推广收益明细列表")
    public Result<IPage<UserLevelMoneyLogListVo>> userLevelMoneyLogListInfo(@RequestBody @Validated UserLevelMoneyLogListDto dto){
        return Result.success(userLevelMoneyLogService.userLevelMoneyLogListInfo(dto));
    }

}
